/*
 * @Description:
 * @Version: 2.0
 * @Autor: wiz
 * @Date: 2023-08-15 14:08:06
 * @LastEditors: swc shanwenchao12138@163.com
 * @LastEditTime: 2025-03-11 14:26:56
 */

/*
 // 面版控制按钮部分是设定按钮的开关状态不能作为按钮多少的依据
*/

import { Tsrv } from '@/services';
import { N_oSetupPanel } from '../types';

type I_setupCompSet = N_oSetupPanel.N_comps.I_setupCompSet;
type I_setupPanel = N_oSetupPanel.N_comps.I_setupPanel;
type COMP_NAME = N_oSetupPanel.N_comps.COMP_NAME;

export class T_compPanelConf {
  private attrCurrentItems: Map<string, Map<string, I_setupCompSet>> = new Map<
    string,
    Map<string, I_setupCompSet>
  >([
    [
      'attrCurrent',
      new Map<string, I_setupCompSet>([
        // 当前tab面板
        ['currentTab', { isShow: true, disabled: false, defVal: null }],
        // 主功能
        ['mainFun', { isShow: true, disabled: false, defVal: null }],
        // 已选择组件
        ['selectedComp', { isShow: true, disabled: false, defVal: null }],
        // 历史组件
        ['historyComps', { isShow: true, disabled: false, defVal: null }]
      ])
    ]
  ]);

  private attrDetailItems: Map<string, Map<string, I_setupCompSet>> = new Map<
    string,
    Map<string, I_setupCompSet>
  >([
    [
      'attrDetail',
      new Map<string, I_setupCompSet>([
        // 当前tab面板
        ['currentTab', { isShow: true, disabled: false, defVal: null }],
        // 功能名
        ['funName', { isShow: true, disabled: false, defVal: '' }],
        // 功能注释
        ['funNote', { isShow: true, disabled: false, defVal: '' }],
        // 引用功能
        [
          'refComp',
          { isShow: false, disabled: true, defVal: [{ value: null }] }
        ],
        // 克隆组件
        ['cloneComp', { isShow: false, disabled: true, defVal: '' }],
        // 多表表格--关联表格
        [
          'multiForm',
          { isShow: false, disabled: true, defVal: [{ value: null }] }
        ],
        // 多表表格--表单样式
        ['formStyle', { isShow: false, disabled: false, defVal: null }],
        // 编辑窗口
        ['editWindow', { isShow: true, disabled: false, defVal: null }],
        // 表格图形模式
        ['tableGraphMode', { isShow: false, disabled: false, defVal: false }],
        // 数据库类型
        [
          'dbType',
          {
            isShow: true,
            disabled: false,
            defVal: N_oSetupPanel.N_comps.DB_TYPE.MYSQL
          }
        ],
        // 组件关联
        ['compLink', { isShow: true, disabled: true, defVal: null }],
        // QBE搜索
        ['QBESearch', { isShow: true, disabled: true, defVal: null }],
        // 条码扫描
        ['bancodeScan', { isShow: true, disabled: true, defVal: null }],
        // 表格样式
        ['tableStyle', { isShow: true, disabled: false, defVal: null }],
        //  工具栏
        ['toolbar', { isShow: true, disabled: false, defVal: null }],
        //  表格数据处理
        ['tableDataSetting', { isShow: true, disabled: false, defVal: null }],
        //  自定义按钮
        ['customButton', { isShow: true, disabled: false, defVal: null }],
        //  联查设置
        ['queryLink', { isShow: true, disabled: false, defVal: null }],
        //  选单配置
        ['selbill', { isShow: true, disabled: false, defVal: null }],
        //  事件
        ['action', { isShow: true, disabled: false, defVal: null }],
        //  行双击配置
        [
          'rowDbClickSetting',
          {
            isShow: true,
            disabled: false,
            defVal: {
              enabled: { isShow: true, disabled: false, defVal: false },
              styleEdit: { isShow: true, disabled: false, defVal: null },
              groupByField: { isShow: true, disabled: false, defVal: null }
            }
          }
        ],
        // 分组配置
        [
          'group',
          {
            isShow: true,
            disabled: true,
            defVal: {
              addGroup: { isShow: true, disabled: false, defVal: null },
              addGroupHead: { isShow: true, disabled: false, defVal: null },
              addGroupBody: { isShow: true, disabled: false, defVal: null },
              form: { isShow: true, disabled: false, defVal: null },
              formStyle: { isShow: true, disabled: false, defVal: null },
              formLayout: { isShow: false, disabled: false, defVal: 'tabs' },
              table: { isShow: true, disabled: false, defVal: null }
            }
          }
        ],
        // 日期导航
        ['dateNav', { isShow: true, disabled: false, defVal: null }],
        // 报表图标编码
        [
          'reportChart',
          {
            isShow: true,
            disabled: false,
            defVal: {
              reportChartCode: { isShow: true, disabled: false, defVal: null },
              chartMode: { isShow: true, disabled: false, defVal: null }
            }
          }
        ]
      ])
    ]
  ]);

  private attrDetailToolbar: Map<string, Map<string, I_setupCompSet>> = new Map<
    string,
    Map<string, I_setupCompSet>
  >([
    [
      'attrDetailToolbar',
      new Map<string, I_setupCompSet>([
        // 当前tab面板
        ['insert', { isShow: true, disabled: false, defVal: true }],
        ['default', { isShow: true, disabled: false, defVal: true }],
        ['delete', { isShow: true, disabled: false, defVal: true }],
        ['save', { isShow: true, disabled: false, defVal: true }],
        ['import', { isShow: true, disabled: false, defVal: true }],
        ['export', { isShow: true, disabled: false, defVal: true }],
        ['globalSearch', { isShow: true, disabled: false, defVal: true }],
        ['refresh', { isShow: true, disabled: false, defVal: true }],
        ['edit', { isShow: true, disabled: false, defVal: true }],
        ['print', { isShow: true, disabled: false, defVal: true }],
        ['audit', { isShow: true, disabled: false, defVal: true }],
        ['unaudit', { isShow: true, disabled: false, defVal: true }],
        ['antiAudit', { isShow: true, disabled: false, defVal: true }],
        ['openData', { isShow: true, disabled: false, defVal: true }],
        ['pasteColumn', { isShow: true, disabled: false, defVal: true }],
        ['jumpFirst', { isShow: true, disabled: false, defVal: true }],
        ['jumpLast', { isShow: true, disabled: false, defVal: true }],
        ['next', { isShow: true, disabled: false, defVal: true }],
        ['previous', { isShow: true, disabled: false, defVal: true }],
        ['search', { isShow: true, disabled: false, defVal: true }],
        ['requestAudit', { isShow: true, disabled: false, defVal: true }],
        ['auditStatus', { isShow: true, disabled: false, defVal: true }],
        ['expandAll', { isShow: true, disabled: false, defVal: true }],
        ['contractAll', { isShow: true, disabled: false, defVal: true }],
        ['mutiSelect', { isShow: true, disabled: false, defVal: true }],
        ['open', { isShow: true, disabled: false, defVal: true }],
        ['exportXML', { isShow: false, disabled: false, defVal: true }],
        ['accountPosted', { isShow: false, disabled: false, defVal: true }],
        ['cancelPost', { isShow: false, disabled: false, defVal: true }],
        ['caseclosed', { isShow: false, disabled: false, defVal: true }],
        ['anticlosing', { isShow: false, disabled: false, defVal: true }],
        ['freeze', { isShow: false, disabled: false, defVal: true }],
        ['unfreeze', { isShow: false, disabled: false, defVal: true }],
        ['void', { isShow: false, disabled: false, defVal: true }],
        ['antivoid', { isShow: false, disabled: false, defVal: true }]
      ])
    ]
  ]);

  private attrLibFeild: Map<string, Map<string, I_setupCompSet>> = new Map<
    string,
    Map<string, I_setupCompSet>
  >([
    [
      'attrLibFeild',
      new Map<string, I_setupCompSet>([
        // 当前tab面板
        ['currentTab', { isShow: true, disabled: false, defVal: null }],
        // 引用表格
        ['refTable', { isShow: false, disabled: false, defVal: null }],
        // 选择字段
        ['selectField', { isShow: true, disabled: true, defVal: null }],
        // 唯一索引
        ['uniqueIndexes', { isShow: true, disabled: true, defVal: null }],
        // 索引
        ['indexes', { isShow: true, disabled: true, defVal: null }],
        // 规则
        ['rules', { isShow: true, disabled: true, defVal: null }],
        // 表头分组
        ['headerGroup', { isShow: true, disabled: true, defVal: null }],
        // 图表设置
        ['charts', { isShow: true, disabled: false, defVal: null }],
        ['btnUnique', { isShow: true, disabled: true, defVal: null }],
        ['btnIndex', { isShow: true, disabled: true, defVal: null }],
        ['btnSelect', { isShow: true, disabled: false, defVal: null }],
        ['btnDelete', { isShow: true, disabled: true, defVal: null }],
        ['btnUp', { isShow: true, disabled: true, defVal: null }],
        ['btnDown', { isShow: true, disabled: true, defVal: null }],
        // baseView专用
        ['btnGetField', { isShow: true, disabled: false, defVal: null }]
      ])
    ]
  ]);

  private attrLibFeildDetail: Map<
    string,
    Map<string, I_setupCompSet>
  > = new Map<string, Map<string, I_setupCompSet>>([
    [
      'attrLibFeildDetail',
      new Map<string, I_setupCompSet>([
        // 字段属性配置 栏位 是否显示
        ['fieldProperties', { isShow: true, disabled: false, defVal: null }],
        // 字段数据格式配置 栏位 是否显示
        ['fieldDataFormat', { isShow: true, disabled: false, defVal: null }],
        // 字段关联配置 栏位 是否显示
        ['fieldAssociation', { isShow: true, disabled: false, defVal: null }],
        // 字段事件 栏位 是否显示
        ['fieldEvevts', { isShow: true, disabled: false, defVal: null }],
        // 子查询 栏位 是否显示
        ['fieldSubquery', { isShow: true, disabled: false, defVal: null }],
        // 字段过滤和排序 栏位 是否显示
        [
          'FieldFilteringAndSorting',
          { isShow: true, disabled: false, defVal: null }
        ],
        // 是否显示
        ['chkBoxIsShow', { isShow: true, disabled: false, defVal: null }],
        // 不为空
        ['chkBoxIsNotNull', { isShow: true, disabled: false, defVal: null }],
        // 描述字段
        ['chkBoxDescField', { isShow: true, disabled: false, defVal: null }],
        // 是否必须
        [
          'chkBoxIsItnecessary',
          { isShow: true, disabled: false, defVal: null }
        ],
        // 禁止输入
        [
          'chkBoxProhibitinput',
          { isShow: true, disabled: false, defVal: null }
        ],
        // 默认筛选 basePanel basegrid 专用
        ['chkBoxDevFilter', { isShow: true, disabled: false, defVal: null }],
        // 节点数据 graph专用
        ['chkBoxNodeData', { isShow: true, disabled: false, defVal: null }],
        // 固定在左侧 basegrid专用
        ['chkBoxFixedLeft', { isShow: true, disabled: false, defVal: null }],
        // 固定在右侧 basegrid专用
        ['chkBoxFixedRight', { isShow: true, disabled: false, defVal: null }],
        // 占位符
        ['placeholder', { isShow: true, disabled: false, defVal: null }],
        // 字段前缀
        [
          'fieldPrefix',
          {
            isShow: true,
            disabled: false,
            defVal: {
              icon: '',
              iconStatus: '',
              content: ''
            }
          }
        ],
        // 字段后缀
        [
          'fieldSuffix',
          {
            isShow: true,
            disabled: false,
            defVal: {
              icon: '',
              iconStatus: '',
              content: ''
            }
          }
        ],
        // 默认值
        ['inputDefVal', { isShow: true, disabled: false, defVal: null }],
        // 别名
        ['i18nFieldAlias', { isShow: true, disabled: false, defVal: null }],
        // 最小宽度
        ['inputMinWidth', { isShow: true, disabled: false, defVal: null }],
        // 宽度
        ['inputWidth', { isShow: true, disabled: false, defVal: null }],
        // 对齐方式 left center right
        ['inputAlignment', { isShow: true, disabled: false, defVal: 'left' }],
        // app 排序
        ['inputAppSort', { isShow: true, disabled: false, defVal: null }],
        // 汇总方式 0(合计) 1(平均值)2(最大值)3(最小值)
        ['inputSummaryMethod', { isShow: true, disabled: false, defVal: null }],
        // 字段格式化 number数值 currency(货币) percent(百分比)
        ['inputFormat', { isShow: true, disabled: false, defVal: null }],
        // 图片高亮
        // <!-- v-if="selectedLibData[editingLibIndex][editingLibSubIndex].formatter.type === 'image'" -->
        ['inputImgHeight', { isShow: true, disabled: false, defVal: null }],
        // 多对一
        [
          'inputM2o',
          {
            isShow: true,
            disabled: false,
            defVal: {
              boxMode: { isShow: true, disabled: false, defVal: false },
              filter: { isShow: true, disabled: false, defVal: '' },
              boxSize: {
                isShow: true,
                disabled: false,
                defVal: {
                  height: 450,
                  width: 700
                }
              },
              fields: {
                isShow: true,
                disabled: false,
                defVal: []
              },
              toolbar: {
                isShow: true,
                disabled: false,
                defVal: {
                  // buttons: [],
                  left: true,
                  right: true
                }
              }
            }
          }
        ],
        // 下拉选项
        [
          'inputDropDownOptions',
          { isShow: true, disabled: false, defVal: null }
        ],
        // 辅助属性字段
        [
          'inputAuxiliaryAttributeField',
          { isShow: true, disabled: false, defVal: null }
        ],
        // 事件 v-if="selectedLibData[editingLibIndex][editingLibSubIndex].actions"
        ['inputEvent', { isShow: true, disabled: false, defVal: null }],
        // 事件值改变时
        [
          'inputEventValChange',
          { isShow: true, disabled: false, defVal: null }
        ],
        // 子查询
        ['inputSubQuery', { isShow: true, disabled: false, defVal: null }],
        // 初始化过滤
        ['inputInitFilter', { isShow: true, disabled: false, defVal: null }],
        // 默认过滤
        ['inputDefFilter', { isShow: true, disabled: false, defVal: null }],
        // 初始化排序 desc asc
        ['inputInitSort', { isShow: true, disabled: false, defVal: null }],

        // graph 专用
        ['isNodeName', { isShow: false, disabled: false, defVal: false }],

        // 初始化过滤权重 initializesortweights
        ['inputInitsortWeights', { isShow: true, disabled: false, defVal: 1 }]
      ])
    ]
  ]);

  private attrMenuItems: Map<string, Map<string, I_setupCompSet>> = new Map<
    string,
    Map<string, I_setupCompSet>
  >([
    [
      'attrMenu',
      new Map<string, I_setupCompSet>([
        // 当前tab面板
        ['currentTab', { isShow: true, disabled: false, defVal: null }],
        // 导航和分组
        ['navigationAndGroup', { isShow: true, disabled: true, defVal: null }],
        // 导航
        ['Navigation', { isShow: true, disabled: true, defVal: null }],
        // 分组
        ['group', { isShow: true, disabled: true, defVal: null }],
        // 父功能
        ['parentFunction', { isShow: true, disabled: true, defVal: null }]
      ])
    ]
  ]);

  private baseGrid: I_setupPanel = {
    attrCurrent: {
      currentTab: null,
      selectedComp: null,
      historyComps: null,
      mainFun: null
    },
    attrDetail: {
      currentTab: null,
      funName: null,
      funNote: null,
      editWindow: { isShow: true, disabled: false, defVal: false },
      tableGraphMode: { isShow: true, disabled: false, defVal: false },
      dbType: {
        isShow: true,
        disabled: false,
        defVal: Tsrv.globalVar.dbType.MYSQL
      },
      compLink: null,
      QBESearch: null,
      bancodeScan: null,
      tableStyle: null,
      toolbar: { isShow: true, disabled: false, defVal: null },
      tableDataSetting: null,
      queryLink: { isShow: false, disabled: false, defVal: null },
      selbill: { isShow: false, disabled: false, defVal: null },
      action: { isShow: true, disabled: false, defVal: null },
      customButton: null,
      rowDbClickSetting: {
        isShow: true,
        disabled: false,
        defVal: {
          enabled: { isShow: true, disabled: false, defVal: false },
          styleEdit: { isShow: false, disabled: false, defVal: null },
          groupByField: { isShow: true, disabled: false, defVal: null }
        }
      },
      group: { isShow: false, disabled: false, defVal: null }
    },
    attrDetailToolbar: {
      insert: null,
      default: null,
      delete: null,
      save: null,
      import: null,
      export: null,
      globalSearch: null,
      refresh: null,
      edit: null,
      print: null,
      audit: { isShow: true, disabled: false, defVal: false },
      unaudit: { isShow: true, disabled: false, defVal: false },
      requestAudit: { isShow: true, disabled: false, defVal: false },
      auditStatus: { isShow: true, disabled: false, defVal: false },
      antiAudit: { isShow: true, disabled: false, defVal: false },
      pasteColumn: null,
      search: { isShow: false, disabled: true, defVal: false },
      exportXML: { isShow: true, disabled: false, defVal: false },
      accountPosted: { isShow: true, disabled: false, defVal: false },
      cancelPost: { isShow: true, disabled: false, defVal: false },
      caseclosed: { isShow: true, disabled: false, defVal: false },
      anticlosing: { isShow: true, disabled: false, defVal: false },
      freeze: { isShow: true, disabled: false, defVal: false },
      unfreeze: { isShow: true, disabled: false, defVal: false },
      void: { isShow: true, disabled: false, defVal: false }
    },
    attrLibFeild: {
      currentTab: null,
      selectField: null,
      uniqueIndexes: null,
      indexes: null,
      rules: null,
      headerGroup: null,
      charts: null,
      btnUnique: null,
      btnIndex: null,
      btnSelect: null,
      btnDelete: null,
      btnUp: null,
      btnDown: null,
      btnGetField: { isShow: false, disabled: false, defVal: null }
    },
    attrLibFeildDetail: {
      fieldProperties: null,
      fieldDataFormat: null,
      fieldAssociation: null,
      fieldEvevts: null,
      fieldSubquery: null,
      FieldFilteringAndSorting: null,
      chkBoxFixedLeft: null,
      chkBoxFixedRight: null,
      chkBoxIsShow: null,
      chkBoxIsNotNull: null,
      chkBoxDescField: null,
      chkBoxIsItnecessary: null,
      chkBoxProhibitinput: null,
      chkBoxDevFilter: null,
      chkBoxNodeData: { isShow: false, disabled: false, defVal: null },
      placeholder: null,
      fieldPrefix: null,
      fieldSuffix: null,
      inputDefVal: null,
      i18nFieldAlias: null,
      inputMinWidth: null,
      inputAlignment: null,
      inputAppSort: { isShow: false, disabled: true, defVal: null },
      inputSummaryMethod: null,
      inputFormat: null,
      inputM2o: null,
      inputDropDownOptions: null,
      inputAuxiliaryAttributeField: null,
      inputEvent: null,
      inputEventValChange: null,
      inputSubQuery: null,
      inputInitFilter: null,
      inputDefFilter: null,
      inputInitSort: null,
      inputInitsortWeights: null
    },
    attrMenu: {
      currentTab: null,
      navigationAndGroup: null,
      Navigation: null,
      group: null,
      parentFunction: null
    }
  };

  private refBaseGrid: I_setupPanel = {
    attrCurrent: {
      currentTab: null,
      selectedComp: null,
      historyComps: null,
      mainFun: null
    },
    attrDetail: {
      currentTab: null,
      funName: null,
      funNote: null,
      editWindow: { isShow: true, disabled: false, defVal: false },
      tableGraphMode: { isShow: true, disabled: false, defVal: false },
      dbType: {
        isShow: true,
        disabled: false,
        defVal: Tsrv.globalVar.dbType.MYSQL
      },
      compLink: null,
      QBESearch: null,
      bancodeScan: null,
      tableStyle: null,
      toolbar: { isShow: true, disabled: false, defVal: null },
      tableDataSetting: null,
      queryLink: { isShow: false, disabled: false, defVal: null },
      selbill: { isShow: false, disabled: false, defVal: null },
      action: { isShow: true, disabled: false, defVal: null },
      customButton: null,
      rowDbClickSetting: {
        isShow: true,
        disabled: false,
        defVal: {
          enabled: { isShow: true, disabled: false, defVal: false },
          styleEdit: { isShow: false, disabled: false, defVal: null },
          groupByField: { isShow: true, disabled: false, defVal: null }
        }
      },
      group: { isShow: false, disabled: false, defVal: null }
    },
    attrDetailToolbar: {
      insert: null,
      default: null,
      delete: null,
      save: null,
      import: null,
      export: null,
      globalSearch: null,
      refresh: null,
      edit: null,
      print: null,
      // audit: null,
      // unaudit: null,
      pasteColumn: null,
      search: { isShow: false, disabled: true, defVal: false },
      exportXML: { isShow: true, disabled: false, defVal: false }
    },
    attrLibFeild: {
      currentTab: null,
      refTable: { isShow: true, disabled: true, defVal: null },
      selectField: null,
      uniqueIndexes: { isShow: false, disabled: true, defVal: null },
      indexes: { isShow: false, disabled: true, defVal: null },
      rules: { isShow: false, disabled: true, defVal: null },
      headerGroup: null,
      charts: null,
      btnUnique: { isShow: false, disabled: true, defVal: null },
      btnIndex: { isShow: false, disabled: true, defVal: null },
      btnSelect: { isShow: false, disabled: true, defVal: null },
      btnDelete: null,
      btnUp: null,
      btnDown: null,
      btnGetField: { isShow: true, disabled: false, defVal: null }
    },
    attrLibFeildDetail: {
      fieldProperties: null,
      fieldDataFormat: null,
      fieldAssociation: { isShow: true, disabled: false, defVal: null },
      fieldEvevts: null,
      fieldSubquery: null,
      FieldFilteringAndSorting: null,
      chkBoxIsShow: null,
      chkBoxIsNotNull: { isShow: false, disabled: false, defVal: null },
      chkBoxDescField: { isShow: false, disabled: false, defVal: null },
      chkBoxIsItnecessary: null,
      chkBoxProhibitinput: null,
      chkBoxDevFilter: null,
      chkBoxNodeData: { isShow: false, disabled: false, defVal: null },
      chkBoxFixedLeft: null,
      chkBoxFixedRight: null,
      placeholder: { isShow: false, disabled: false, defVal: null },
      fieldPrefix: null,
      fieldSuffix: null,
      inputDefVal: null,
      i18nFieldAlias: null,
      inputMinWidth: null,
      inputAlignment: { isShow: false, disabled: false, defVal: null },
      inputAppSort: { isShow: false, disabled: true, defVal: null },
      inputSummaryMethod: { isShow: false, disabled: false, defVal: null },
      inputFormat: null,
      inputM2o: { isShow: true, disabled: true, defVal: null },
      inputDropDownOptions: { isShow: true, disabled: true, defVal: null },
      inputAuxiliaryAttributeField: {
        isShow: false,
        disabled: false,
        defVal: null
      },
      inputEvent: null,
      inputEventValChange: null,
      inputSubQuery: { isShow: true, disabled: true, defVal: null },
      inputInitFilter: null,
      inputDefFilter: null,
      inputInitSort: null,
      inputInitsortWeights: null
    },
    attrMenu: {
      currentTab: null,
      navigationAndGroup: null,
      Navigation: null,
      group: null,
      parentFunction: null
    }
  };

  private baseView: I_setupPanel = {
    attrCurrent: {
      currentTab: null,
      selectedComp: null,
      historyComps: null,
      mainFun: null
    },
    attrDetail: {
      currentTab: null,
      funName: null,
      funNote: null,
      editWindow: null,
      tableGraphMode: { isShow: true, disabled: false, defVal: false },
      dbType: {
        isShow: true,
        disabled: false,
        defVal: Tsrv.globalVar.dbType.MYSQL
      },
      compLink: null,
      QBESearch: null,
      bancodeScan: { isShow: false, disabled: false, defVal: null },
      tableStyle: null,
      toolbar: null,
      tableDataSetting: null,
      queryLink: { isShow: false, disabled: false, defVal: null },
      selbill: { isShow: false, disabled: false, defVal: null },
      action: { isShow: true, disabled: false, defVal: null },
      customButton: { isShow: true, disabled: false, defVal: null },
      rowDbClickSetting: {
        isShow: true,
        disabled: false,
        defVal: {
          enabled: { isShow: true, disabled: false, defVal: false },
          styleEdit: { isShow: false, disabled: false, defVal: null },
          groupByField: { isShow: false, disabled: false, defVal: null },
          targetDoc: { isShow: true, disabled: false, defVal: null }
        }
      },
      group: { isShow: false, disabled: false, defVal: null }
    },
    attrDetailToolbar: {
      default: null,
      export: null,
      globalSearch: null,
      refresh: null,
      print: null,
      search: { isShow: false, disabled: true, defVal: false },
      exportXML: { isShow: true, disabled: false, defVal: false },
      contractAll: null
    },
    attrLibFeild: {
      currentTab: null,
      selectField: null,
      uniqueIndexes: { isShow: false, disabled: false, defVal: null },
      indexes: { isShow: false, disabled: false, defVal: null },
      rules: { isShow: false, disabled: false, defVal: null },
      headerGroup: { isShow: false, disabled: false, defVal: null },
      charts: { isShow: false, disabled: false, defVal: null },
      btnUnique: { isShow: false, disabled: false, defVal: null },
      btnIndex: { isShow: false, disabled: false, defVal: null },
      btnSelect: { isShow: false, disabled: false, defVal: null },
      btnDelete: null,
      btnUp: null,
      btnDown: null,
      btnGetField: null
    },
    attrLibFeildDetail: {
      fieldProperties: null,
      fieldDataFormat: null,
      fieldAssociation: null,
      fieldEvevts: { isShow: false, disabled: false, defVal: null },
      fieldSubquery: { isShow: false, disabled: false, defVal: null },
      FieldFilteringAndSorting: null,
      chkBoxIsShow: null,
      chkBoxIsNotNull: { isShow: false, disabled: false, defVal: null },
      chkBoxDescField: { isShow: false, disabled: false, defVal: null },
      chkBoxIsItnecessary: { isShow: false, disabled: false, defVal: null },
      chkBoxProhibitinput: { isShow: false, disabled: false, defVal: null },
      chkBoxDevFilter: null,
      chkBoxNodeData: { isShow: false, disabled: false, defVal: null },
      chkBoxFixedLeft: null,
      chkBoxFixedRight: null,
      placeholder: null,
      fieldPrefix: null,
      fieldSuffix: null,
      inputDefVal: { isShow: false, disabled: false, defVal: null },
      i18nFieldAlias: null,
      inputMinWidth: null,
      inputAlignment: null,
      inputAppSort: { isShow: false, disabled: false, defVal: null },
      inputSummaryMethod: null,
      inputFormat: null,
      inputM2o: { isShow: true, disabled: false, defVal: null },
      inputDropDownOptions: { isShow: false, disabled: false, defVal: null },
      inputAuxiliaryAttributeField: {
        isShow: false,
        disabled: false,
        defVal: null
      },
      inputEvent: { isShow: false, disabled: false, defVal: null },
      inputEventValChange: { isShow: false, disabled: false, defVal: null },
      inputSubQuery: { isShow: false, disabled: false, defVal: null },
      inputInitFilter: null,
      inputDefFilter: null,
      inputInitSort: null,
      inputInitsortWeights: null
    },
    attrMenu: {
      currentTab: null,
      navigationAndGroup: null,
      Navigation: null,
      group: null,
      parentFunction: null
    }
  };

  private basePanel: I_setupPanel = {
    attrCurrent: {
      currentTab: null,
      selectedComp: null,
      historyComps: null,
      mainFun: null
    },
    attrDetail: {
      currentTab: null,
      funName: null,
      funNote: null,
      editWindow: null,
      dbType: {
        isShow: true,
        disabled: true,
        defVal: Tsrv.globalVar.dbType.MYSQL
      },
      compLink: { isShow: false, disabled: true, defVal: null },
      bancodeScan: null, // 扫码枪
      tableStyle: { isShow: false, disabled: true, defVal: null },
      toolbar: null,
      action: null,
      tableDataSetting: null,
      customButton: null,
      queryLink: { isShow: false, disabled: false, defVal: null },
      selbill: { isShow: false, disabled: false, defVal: null },
      rowDbClickSetting: { isShow: false, disabled: false, defVal: null },
      group: {
        isShow: true,
        disabled: true,
        defVal: {
          addGroup: { isShow: true, disabled: false, defVal: null },
          addGroupHead: { isShow: true, disabled: false, defVal: null },
          addGroupBody: { isShow: true, disabled: false, defVal: null },
          form: { isShow: true, disabled: false, defVal: null },
          formStyle: {
            isShow: true,
            disabled: false,
            defVal: {
              // columnNum: { isShow: false, disabled: false, defVal: null },
              // pixelWidth: { isShow: false, disabled: false, defVal: null },
              // percentageWidth: { isShow: false, disabled: false, defVal: null },
              isBottom: { isShow: true, disabled: false, defVal: null }
            }
          },
          table: { isShow: true, disabled: false, defVal: null }
        }
      }
    },
    attrDetailToolbar: {
      insert: null,
      delete: null,
      save: null,
      import: { isShow: false, disabled: true, defVal: false },
      export: { isShow: false, disabled: true, defVal: false },
      jumpFirst: null,
      jumpLast: null,
      next: null,
      previous: null,
      refresh: null,
      edit: null,
      print: null,
      audit: null,
      unaudit: null,
      antiAudit: { isShow: true, disabled: false, defVal: true },
      search: null,
      requestAudit: null,
      auditStatus: null,
      accountPosted: { isShow: true, disabled: false, defVal: false },
      cancelPost: { isShow: true, disabled: false, defVal: false },
      caseclosed: { isShow: true, disabled: false, defVal: false },
      anticlosing: { isShow: true, disabled: false, defVal: false },
      freeze: { isShow: true, disabled: false, defVal: false },
      unfreeze: { isShow: true, disabled: false, defVal: false },
      void: { isShow: true, disabled: false, defVal: false }
    },
    attrLibFeild: {
      currentTab: null,
      selectField: null,
      uniqueIndexes: null,
      indexes: null,
      rules: null,
      headerGroup: { isShow: false, disabled: true, defVal: null },
      charts: { isShow: false, disabled: true, defVal: null },
      btnUnique: null,
      btnIndex: null,
      btnSelect: null,
      btnDelete: null,
      btnUp: null,
      btnDown: null,
      btnGetField: { isShow: false, disabled: false, defVal: null }
    },
    attrLibFeildDetail: {
      fieldProperties: null,
      fieldDataFormat: null,
      fieldAssociation: null,
      fieldEvevts: null,
      fieldSubquery: null,
      FieldFilteringAndSorting: null,
      chkBoxIsShow: null,
      chkBoxIsNotNull: null,
      chkBoxDescField: null,
      chkBoxIsItnecessary: null,
      chkBoxProhibitinput: null,
      chkBoxDevFilter: null,
      chkBoxNodeData: { isShow: false, disabled: false, defVal: null },
      placeholder: null,
      fieldPrefix: null,
      fieldSuffix: null,
      inputDefVal: null,
      i18nFieldAlias: null,
      inputMinWidth: null,
      inputWidth: null,
      inputAlignment: null,
      inputAppSort: { isShow: false, disabled: true, defVal: null },
      inputSummaryMethod: null,
      inputFormat: null,
      inputM2o: null,
      inputDropDownOptions: null,
      inputAuxiliaryAttributeField: null,
      inputEvent: null,
      inputEventValChange: null,
      inputSubQuery: null,
      inputInitFilter: null,
      inputDefFilter: null,
      inputInitSort: null,
      inputInitsortWeights: null
    },
    attrMenu: {
      currentTab: null,
      navigationAndGroup: null,
      Navigation: null,
      group: null,
      parentFunction: null
    }
  };

  private clonePasePanel: I_setupPanel = {
    attrCurrent: {
      currentTab: null,
      selectedComp: null,
      historyComps: null,
      mainFun: null
    },
    attrDetail: {
      currentTab: null,
      funName: null,
      funNote: null,
      editWindow: null,
      dbType: {
        isShow: true,
        disabled: true,
        defVal: Tsrv.globalVar.dbType.MYSQL
      },
      compLink: { isShow: false, disabled: true, defVal: null },
      cloneComp: { isShow: true, disabled: true, defVal: null },
      tableStyle: { isShow: false, disabled: true, defVal: null },
      toolbar: null,
      action: null,
      tableDataSetting: null,
      customButton: null,
      queryLink: { isShow: false, disabled: false, defVal: null },
      selbill: { isShow: false, disabled: false, defVal: null },
      rowDbClickSetting: { isShow: false, disabled: false, defVal: null },
      group: {
        isShow: true,
        disabled: true,
        defVal: {
          addGroup: { isShow: true, disabled: false, defVal: null },
          addGroupHead: { isShow: true, disabled: false, defVal: null },
          addGroupBody: { isShow: true, disabled: false, defVal: null },
          form: { isShow: true, disabled: false, defVal: null },
          formStyle: {
            isShow: true,
            disabled: false,
            defVal: {
              // columnNum: { isShow: false, disabled: false, defVal: null },
              // pixelWidth: { isShow: false, disabled: false, defVal: null },
              // percentageWidth: { isShow: false, disabled: false, defVal: null },
              isBottom: { isShow: true, disabled: false, defVal: null }
            }
          },
          table: { isShow: true, disabled: false, defVal: null }
        }
      }
    },
    attrDetailToolbar: {
      insert: null,
      delete: null,
      save: null,
      import: { isShow: false, disabled: true, defVal: false },
      export: { isShow: false, disabled: true, defVal: false },
      jumpFirst: null,
      jumpLast: null,
      next: null,
      previous: null,
      edit: null,
      print: null,
      audit: null,
      unaudit: null,
      antiAudit: { isShow: true, disabled: false, defVal: false },
      search: null,
      requestAudit: { isShow: true, disabled: false, defVal: false },
      auditStatus: { isShow: true, disabled: false, defVal: false }
    },
    attrLibFeild: {
      currentTab: null,
      selectField: null,
      uniqueIndexes: null,
      indexes: null,
      rules: null,
      headerGroup: { isShow: false, disabled: true, defVal: null },
      charts: { isShow: false, disabled: true, defVal: null },
      btnUnique: null,
      btnIndex: null,
      btnSelect: { isShow: true, disabled: true, defVal: null },
      btnDelete: { isShow: true, disabled: true, defVal: null },
      btnUp: null,
      btnDown: null,
      btnGetField: { isShow: false, disabled: false, defVal: null }
    },
    attrLibFeildDetail: {
      fieldProperties: null,
      fieldDataFormat: null,
      fieldAssociation: null,
      fieldEvevts: null,
      fieldSubquery: null,
      FieldFilteringAndSorting: null,
      chkBoxIsShow: null,
      chkBoxIsNotNull: null,
      chkBoxDescField: null,
      chkBoxIsItnecessary: null,
      chkBoxProhibitinput: null,
      chkBoxDevFilter: null,
      chkBoxNodeData: { isShow: false, disabled: false, defVal: null },
      placeholder: null,
      fieldPrefix: null,
      fieldSuffix: null,
      inputDefVal: null,
      i18nFieldAlias: null,
      inputMinWidth: null,
      inputWidth: null,
      inputAlignment: null,
      inputAppSort: { isShow: false, disabled: true, defVal: null },
      inputSummaryMethod: null,
      inputFormat: null,
      inputM2o: null,
      inputDropDownOptions: null,
      inputAuxiliaryAttributeField: null,
      inputEvent: null,
      inputEventValChange: null,
      inputSubQuery: null,
      inputInitFilter: null,
      inputDefFilter: null,
      inputInitSort: null,
      inputInitsortWeights: null
    },
    attrMenu: {
      currentTab: null,
      navigationAndGroup: null,
      Navigation: null,
      group: null,
      parentFunction: null
    }
  };

  private treeGrid: I_setupPanel = {
    attrCurrent: {
      currentTab: null,
      selectedComp: null,
      historyComps: null,
      mainFun: null
    },
    attrDetail: {
      currentTab: null,
      funName: { isShow: false, disabled: true, defVal: '' },
      funNote: { isShow: false, disabled: true, defVal: null },
      editWindow: null,
      dbType: {
        isShow: true,
        disabled: false,
        defVal: Tsrv.globalVar.dbType.MYSQL
      },
      compLink: null,
      tableStyle: null,
      toolbar: null,
      action: { isShow: false, disabled: false, defVal: null },
      tableDataSetting: null,
      queryLink: { isShow: false, disabled: false, defVal: null },
      selbill: { isShow: false, disabled: false, defVal: null },
      customButton: null,
      rowDbClickSetting: { isShow: false, disabled: false, defVal: null },
      group: { isShow: false, disabled: false, defVal: null }
    },
    attrDetailToolbar: {
      default: { isShow: true, disabled: false, defVal: null },
      expandAll: null,
      contractAll: null,
      mutiSelect: null
    },
    attrLibFeild: {
      currentTab: { isShow: true, disabled: true, defVal: false },
      selectField: null,
      uniqueIndexes: null,
      indexes: null,
      rules: null,
      headerGroup: null,
      charts: null
    },
    attrMenu: {
      currentTab: { isShow: false, disabled: true, defVal: false },
      navigationAndGroup: null,
      Navigation: null,
      group: null,
      parentFunction: null
    }
  };

  private dateNav: I_setupPanel = {
    attrCurrent: {
      currentTab: null,
      selectedComp: null,
      historyComps: null
    },
    attrDetail: {
      currentTab: null,
      compLink: null,
      dateNav: null
    }
  };

  private baseTab: I_setupPanel = {
    attrCurrent: {
      currentTab: null,
      selectedComp: null,
      historyComps: null
    },
    attrDetail: {
      currentTab: null,
      compLink: null,
      dateNav: null
    }
  };

  private graph: I_setupPanel = {
    attrCurrent: {
      currentTab: null,
      selectedComp: null,
      historyComps: null,
      mainFun: null
    },
    attrDetail: {
      currentTab: null,
      funName: null,
      funNote: null,
      editWindow: null,
      dbType: {
        isShow: true,
        disabled: true,
        defVal: Tsrv.globalVar.dbType.MYSQL
      },
      compLink: null,
      tableStyle: null,
      toolbar: null,
      action: null,
      tableDataSetting: null,
      queryLink: { isShow: false, disabled: false, defVal: null },
      selbill: { isShow: false, disabled: false, defVal: null },
      rowDbClickSetting: { isShow: false, disabled: false, defVal: null },
      group: { isShow: false, disabled: false, defVal: null }
    },
    attrDetailToolbar: {
      insert: null,
      default: null,
      delete: null,
      save: null,
      edit: null,
      audit: null,
      unaudit: null,
      antiAudit: null,
      open: null
    },
    attrLibFeild: {
      currentTab: null,
      selectField: null,
      uniqueIndexes: null,
      indexes: null,
      rules: null,
      headerGroup: { isShow: false, disabled: true, defVal: null },
      charts: { isShow: false, disabled: true, defVal: null },
      btnUnique: null,
      btnIndex: null,
      btnSelect: null,
      btnDelete: null,
      btnUp: null,
      btnDown: null,
      btnGetField: { isShow: false, disabled: false, defVal: null }
    },
    attrLibFeildDetail: {
      fieldProperties: null,
      fieldDataFormat: null,
      fieldAssociation: null,
      fieldEvevts: null,
      fieldSubquery: null,
      FieldFilteringAndSorting: null,
      chkBoxIsShow: null,
      chkBoxIsNotNull: null,
      chkBoxDescField: null,
      chkBoxIsItnecessary: null,
      chkBoxProhibitinput: null,
      chkBoxDevFilter: null,
      chkBoxNodeData: null,
      placeholder: null,
      fieldPrefix: { isShow: false, disabled: true, defVal: null },
      fieldSuffix: { isShow: false, disabled: true, defVal: null },
      inputDefVal: null,
      i18nFieldAlias: null,
      inputMinWidth: null,
      inputAlignment: null,
      inputAppSort: { isShow: false, disabled: true, defVal: null },
      inputSummaryMethod: { isShow: false, disabled: true, defVal: null },
      inputFormat: null,
      inputM2o: null,
      inputDropDownOptions: null,
      inputAuxiliaryAttributeField: null,
      inputEvent: { isShow: false, disabled: true, defVal: null },
      inputEventValChange: null,
      inputSubQuery: null,
      inputInitFilter: null,
      inputDefFilter: null,
      inputInitSort: null,
      inputInitsortWeights: null,
      isNodeName: { isShow: true, disabled: false, defVal: false }
    },
    attrMenu: {
      currentTab: null,
      navigationAndGroup: null,
      Navigation: null,
      group: null,
      parentFunction: null
    }
  };

  private refComp: I_setupPanel = {
    attrCurrent: {
      mainFun: { isShow: false, disabled: true, defVal: true },
      currentTab: null,
      selectedComp: null,
      historyComps: null
    },
    attrDetail: {
      funName: {
        isShow: true,
        disabled: true,
        defVal: this.getfunName('_sys_ref_comp_')
      },
      funNote: {
        isShow: true,
        disabled: true,
        defVal: '虚拟的容器功能,它只接受引用表格组件，引用组件只能是最下层组件'
      },
      currentTab: null,
      refComp: {
        isShow: true,
        disabled: false,
        defVal: [{ value: null }]
      }
      // compLink: null
    }
  };

  private multiForm: I_setupPanel = {
    attrCurrent: {
      mainFun: null,
      currentTab: null,
      selectedComp: null,
      historyComps: null
    },
    attrDetail: {
      funName: null,
      funNote: null,
      currentTab: null,
      toolbar: { isShow: true, disabled: false, defVal: null },
      tableDataSetting: { isShow: true, disabled: false, defVal: null },
      multiForm: {
        isShow: true,
        disabled: false,
        defVal: [{ value: null }]
      },
      formStyle: { isShow: true, disabled: false, defVal: null }
      // compLink: null
    },
    attrDetailToolbar: {
      insert: null,
      delete: null,
      save: null,
      refresh: null,
      edit: null
    },
    attrMenu: {
      currentTab: null,
      navigationAndGroup: null,
      Navigation: null,
      group: null,
      parentFunction: null
    }
  };

  private cBaseForm: I_setupPanel = {
    attrCurrent: {
      currentTab: null,
      selectedComp: null,
      historyComps: null,
      mainFun: null
    },
    attrDetail: {
      currentTab: null,
      funName: null,
      funNote: null,
      editWindow: null,
      dbType: {
        isShow: true,
        disabled: true,
        defVal: Tsrv.globalVar.dbType.MYSQL
      },
      tableStyle: null,
      // 缺少表单样式
      toolbar: null,
      compLink: { isShow: true, disabled: false, defVal: null },
      tableDataSetting: { isShow: false, disabled: true, defVal: null },
      queryLink: { isShow: false, disabled: true, defVal: null },
      selbill: { isShow: false, disabled: true, defVal: null },
      action: null,
      customButton: null,
      rowDbClickSetting: { isShow: false, disabled: false, defVal: null },
      group: {
        isShow: true,
        disabled: true,
        defVal: {
          addGroup: { isShow: true, disabled: false, defVal: null },
          addGroupHead: { isShow: true, disabled: false, defVal: null },
          addGroupBody: { isShow: false, disabled: false, defVal: null },
          form: { isShow: true, disabled: false, defVal: null },
          formStyle: {
            isShow: false,
            disabled: false,
            defVal: {
              // columnNum: { isShow: false, disabled: false, defVal: null },
              isBottom: { isShow: false, disabled: false, defVal: null }
            }
          },
          formLayout: { isShow: true, disabled: false, defVal: 'tabs' }, // collapse / tabs
          table: { isShow: false, disabled: false, defVal: null }
        }
      }
    },
    attrDetailToolbar: {
      // insert: null,
      // default: null,
      // delete: null,
      // save: null,
      // edit: null,
      // print: null,
      // refresh: null
      insert: null,
      delete: null,
      save: null,
      import: { isShow: false, disabled: true, defVal: false },
      export: { isShow: false, disabled: true, defVal: false },
      jumpFirst: null,
      jumpLast: null,
      next: null,
      previous: null,
      edit: null,
      print: null,
      audit: null,
      unaudit: null,
      antiAudit: { isShow: false, disabled: false, defVal: false },
      search: null,
      requestAudit: { isShow: true, disabled: false, defVal: false },
      auditStatus: { isShow: true, disabled: false, defVal: false }
    },
    attrLibFeild: {
      currentTab: null,
      selectField: null,
      uniqueIndexes: null,
      indexes: null,
      rules: null,
      headerGroup: { isShow: false, disabled: true, defVal: null },
      charts: { isShow: false, disabled: true, defVal: null },
      btnUnique: null,
      btnIndex: null,
      btnSelect: null,
      btnDelete: null,
      btnUp: null,
      btnDown: null,
      btnGetField: { isShow: false, disabled: false, defVal: null }
    },
    attrLibFeildDetail: {
      fieldProperties: null,
      fieldDataFormat: null,
      fieldAssociation: null,
      fieldEvevts: null,
      fieldSubquery: null,
      FieldFilteringAndSorting: null,
      chkBoxIsShow: null,
      chkBoxIsNotNull: null,
      chkBoxDescField: null,
      chkBoxIsItnecessary: null,
      chkBoxProhibitinput: null,
      chkBoxDevFilter: null,
      chkBoxNodeData: { isShow: false, disabled: false, defVal: null },
      placeholder: null,
      fieldPrefix: null,
      fieldSuffix: null,
      inputDefVal: null,
      i18nFieldAlias: null,
      inputMinWidth: null,
      inputWidth: null,
      inputAlignment: null,
      inputAppSort: { isShow: false, disabled: true, defVal: null },
      inputSummaryMethod: { isShow: false, disabled: true, defVal: null },
      inputFormat: null,
      inputM2o: null,
      inputDropDownOptions: null,
      inputAuxiliaryAttributeField: null,
      inputEvent: null,
      inputEventValChange: null,
      inputSubQuery: null,
      inputInitFilter: null,
      inputDefFilter: null,
      inputInitSort: null,
      inputInitsortWeights: null
    },
    attrMenu: {
      currentTab: null,
      navigationAndGroup: null,
      Navigation: null,
      group: null,
      parentFunction: null
    }
  };

  public getfunName(type): string {
    return `${type}${Tsrv.utils.custUUID(10, 16, 'letters')}`.toLowerCase();
  }

  private refGraph: I_setupPanel = {
    attrCurrent: {
      currentTab: null,
      selectedComp: null,
      historyComps: null,
      mainFun: null
    },
    attrDetail: {
      currentTab: null,
      funName: null,
      funNote: null,
      editWindow: null,
      dbType: {
        isShow: true,
        disabled: true,
        defVal: Tsrv.globalVar.dbType.MYSQL
      },
      compLink: null,
      tableStyle: null,
      toolbar: null,
      action: null,
      tableDataSetting: null,
      queryLink: null,
      selbill: null,
      rowDbClickSetting: { isShow: false, disabled: false, defVal: null },
      group: { isShow: false, disabled: false, defVal: null }
    },
    attrDetailToolbar: {
      default: null,
      insert: null,
      delete: null,
      edit: null,
      save: null,
      open: null
    },
    attrLibFeild: {
      currentTab: null,
      selectField: null,
      uniqueIndexes: null,
      indexes: null,
      rules: null,
      headerGroup: { isShow: false, disabled: true, defVal: null },
      charts: { isShow: false, disabled: true, defVal: null },
      btnUnique: null,
      btnIndex: null,
      btnSelect: null,
      btnDelete: null,
      btnUp: null,
      btnDown: null,
      btnGetField: { isShow: false, disabled: false, defVal: null }
    },
    attrLibFeildDetail: {
      fieldProperties: null,
      fieldDataFormat: null,
      fieldAssociation: null,
      fieldEvevts: { isShow: false, disabled: false, defVal: null },
      fieldSubquery: null,
      FieldFilteringAndSorting: null,
      chkBoxIsShow: null,
      chkBoxIsNotNull: null,
      chkBoxDescField: null,
      chkBoxIsItnecessary: null,
      chkBoxProhibitinput: null,
      chkBoxDevFilter: null,
      // chkBoxNodeData: null,
      placeholder: null,
      fieldPrefix: { isShow: false, disabled: true, defVal: null },
      fieldSuffix: { isShow: false, disabled: true, defVal: null },
      inputDefVal: null,
      i18nFieldAlias: null,
      inputMinWidth: null,
      inputAlignment: null,
      inputAppSort: { isShow: false, disabled: true, defVal: null },
      inputSummaryMethod: { isShow: false, disabled: true, defVal: null },
      inputFormat: null,
      inputM2o: null,
      inputDropDownOptions: null,
      inputAuxiliaryAttributeField: null,
      inputEvent: { isShow: false, disabled: true, defVal: null },
      inputEventValChange: null,
      inputSubQuery: null,
      inputInitFilter: null,
      inputDefFilter: null,
      inputInitSort: null,
      inputInitsortWeights: null
      // isNodeName: { isShow: true, disabled: false, defVal: false }
    },
    attrMenu: {
      currentTab: null,
      navigationAndGroup: null,
      Navigation: null,
      group: null,
      parentFunction: null
    }
  };

  private reportChsrt: I_setupPanel = {
    attrCurrent: {
      currentTab: null,
      mainFun: null,
      selectedComp: null,
      historyComps: null
    },
    attrDetail: {
      currentTab: null,
      // funName: {
      //   isShow: true,
      //   disabled: true,
      //   defVal: this.getfunName('_sys_report_chart_')
      // },
      funName: null,
      funNote: null,
      reportChart: {
        isShow: true,
        disabled: false,
        defVal: {
          reportChartCode: { isShow: true, disabled: false, defVal: '' },
          chartMode: { isShow: true, disabled: false, defVal: '' }
        }
      }
    },
    attrMenu: {
      currentTab: null,
      navigationAndGroup: null,
      Navigation: null,
      group: null,
      parentFunction: null
    }
  };

  private getItm(itm: I_setupPanel): I_setupPanel {
    Object.keys(itm).forEach(k => {
      if (this.attrCurrentItems.has(k)) {
        this.handleItems(itm, this.attrCurrentItems.get(k), k);
      } else if (this.attrDetailItems.has(k)) {
        this.handleItems(itm, this.attrDetailItems.get(k), k);
      } else if (this.attrDetailToolbar.has(k)) {
        this.handleItems(itm, this.attrDetailToolbar.get(k), k);
      } else if (this.attrLibFeild.has(k)) {
        this.handleItems(itm, this.attrLibFeild.get(k), k);
      } else if (this.attrLibFeildDetail.has(k)) {
        this.handleItems(itm, this.attrLibFeildDetail.get(k), k);
      } else if (this.attrMenuItems) {
        this.handleItems(itm, this.attrMenuItems.get(k), k);
      } else {
        delete itm[k];
      }
    });
    return itm;
  }

  private handleItems(
    itm: I_setupPanel,
    ps: Map<string, N_oSetupPanel.N_comps.I_setupCompSet>,
    k: string
  ) {
    const item = itm[k];
    Object.keys(item).forEach(pk => {
      if (!ps.has(pk)) {
        delete item[pk];
      } else {
        if (item[pk] === null) {
          item[pk] = ps.get(pk);
        }
      }
    });
  }

  public getCompPanelSet(mode: COMP_NAME): I_setupPanel {
    switch (mode) {
      case N_oSetupPanel.N_comps.COMP_NAME.BASE_GRID:
        return this.getItm(this.baseGrid);
      case N_oSetupPanel.N_comps.COMP_NAME.BASE_PANEL:
        return this.getItm(this.basePanel);
      case N_oSetupPanel.N_comps.COMP_NAME.TREE_GRID:
        return this.getItm(this.treeGrid);
      case N_oSetupPanel.N_comps.COMP_NAME.DATE_NAV:
        return this.getItm(this.dateNav);
      case N_oSetupPanel.N_comps.COMP_NAME.GRAPH:
        return this.getItm(this.graph);
      case N_oSetupPanel.N_comps.COMP_NAME.BASE_VIEW:
        return this.getItm(this.baseView);
      case N_oSetupPanel.N_comps.COMP_NAME.REF_COMP:
        return this.getItm(this.refComp);
      case N_oSetupPanel.N_comps.COMP_NAME.MULTI_FORM:
        return this.getItm(this.multiForm);
      case N_oSetupPanel.N_comps.COMP_NAME.C_BASE_FORM:
        return this.getItm(this.cBaseForm);
      case N_oSetupPanel.N_comps.COMP_NAME.REF_GRAPH:
        return this.getItm(this.refGraph);
      case N_oSetupPanel.N_comps.COMP_NAME.REF_BASE_GRID:
        return this.getItm(this.refBaseGrid);
      case N_oSetupPanel.N_comps.COMP_NAME.REPORT_CHART:
        return this.getItm(this.reportChsrt);
      case N_oSetupPanel.N_comps.COMP_NAME.BASE_TAB:
        return this.getItm(this.baseTab);
      case N_oSetupPanel.N_comps.COMP_NAME.CLONE_BASE_PANEL:
        return this.getItm(this.clonePasePanel);
      default:
        throw new Error('不能识别的类型');
    }
  }

  // // 对比修正面板配置,多加少补
  // public amendments(compName: COMP_NAME, currConf: I_setupPanel): I_setupPanel {
  //   if (Tsrv.utils.noValue(currConf)) {
  //     return currConf;
  //   }
  //   const dConf = this.getCompPanelSet(compName);
  //   if (Tsrv.utils.compareObjectProperties(currConf, dConf, 10)) {
  //     this.deepTraverse(currConf, dConf);
  //   }
  //   for (const key in currConf) {
  //     delete currConf[key];
  //   }
  //   Object.assign(currConf, dConf);
  //   return currConf;
  // }

  // private deepTraverse(
  //   currConf: I_setupPanel,
  //   dConf: I_setupPanel,
  //   path: string = ''
  // ) {
  //   for (const key in currConf) {
  //     // eslint-disable-next-line no-prototype-builtins
  //     if (currConf.hasOwnProperty(key)) {
  //       // 构建当前属性的路径
  //       const currentPath = path === '' ? key : `${path}.${key}`;
  //       // 如果当前属性值是对象，则递归调用 deepTraverse 函数进行深度遍历
  //       if (typeof currConf[key] === 'object' && currConf[key] !== null) {
  //         this.deepTraverse(currConf[key], dConf, currentPath);
  //       } else {
  //         const v = Tsrv.utils.getObjValByPath(currConf, currentPath);
  //         if (!Tsrv.utils.noValue(v)) {
  //           Tsrv.utils.setObjValByPath(dConf, currentPath, v);
  //         }
  //       }
  //     }
  //   }
  // }
}
